package com.thghh.ch5.tree;

/**
 * @author Zhikang.Peng
 * @version 1.0
 * @email thghh@qq.com
 * @date 2020/9/10 10:01
 */
public class LeafNode implements BinNode<String> {
    private String var;

    public LeafNode(String var) {
        this.var = var;
    }

    public String element() {
        return var;
    }

    public String setElement(String e) {
        return var = e;
    }

    public BinNode left() {
        throw new UnsupportedOperationException();
    }

    public BinNode setLeft(BinNode b) {
        throw new UnsupportedOperationException();
    }

    public BinNode right() {
        throw new UnsupportedOperationException();
    }

    public BinNode right(BinNode b) {
        throw new UnsupportedOperationException();
    }

    public boolean isLeaf() {
        return true;
    }
}
